home *** CD-ROM | disk | FTP | other *** search
/ STraTOS 1997 April & May / STraTOS 1 - 1997 April & May.iso / CD01 / INTERNET / SITES / RAND / UNSPLIT / text0284.txt < prev    next >
Encoding:
Text File  |  1997-02-06  |  2.0 KB  |  46 lines

  1. > :) Some time ago, people here talked about a tool that makes it
  2. > :) possible to develop a specialized compiler very quickly.
  3. >
  4. > I would love to hear more about this compiler - could anyone provide any
  5. > further information, for example, downloadables/links etc.?
  6.  
  7. The tools Bertrand is talking about are lex and yacc, or their GNU
  8. equivalents flex and bison.
  9.  
  10. Lex is a lexical analyser generator. Simply put, it can create a program
  11. that breaks a text down into components according to rules. In a compiler
  12. it would be used to recognize numbers, keywords etc.
  13.  
  14. Yacc (yet another compiler compiler) will create a parser for 'any' language
  15. given a grammar for it. Usually you send the symbols extracted by lex into
  16. yacc, which finally calls your own C routines to build a graph of the input.
  17.  
  18. Lex/yacc are of course useful for lots of things that are not as complicated
  19. as programming languages. A calculator, for example, is incredibly easy to do.
  20.  
  21.  
  22. Any UNIX system should have lex and yacc, and many also have flex and bison.
  23.  
  24. If you're interested I could locate a simple Pascal-like compilator or a 
  25. single-pass RISC assembler I wrote for courses at the University a couple
  26. of years ago. I also have a 70% finished compiler for a functional language,
  27. which I soon must finish up (the lecture part of that course ended well
  28. before Christmas, but...).
  29.  
  30. > I only ask in view of Nicklas Larsson's Glasnost idea (to create a new games
  31. > orientated programming language).
  32.  
  33. Since he's studying computer technology, he's very likely to already know
  34. about the programs I mentioned.
  35.  
  36. By the way, is the information on his Web page all that is available?
  37. From the description there, it seems to me like using ordinary C/C++ with
  38. a few libraries and perhaps a real time kernal would be better.
  39.  
  40. -- 
  41.   Chalmers University   | Why are these |  e-mail:   rand@cd.chalmers.se
  42.      of Technology      |  .signatures  |            johan@rand.thn.htu.se
  43.                         | so hard to do |  WWW/ftp:  rand.thn.htu.se
  44.    Gothenburg, Sweden   |     well?     |            (MGIFv5, QLem, BAD MOOD)
  45.  
  46.